#!/bin/bash

if [ $# -ne 2 ]; then
        echo "Usage: rmconstrain.sh PROJECT pkg-list"
        exit 1
fi

files=($(cat $2))
declare -i i

for ((i=0; i<${#files[@]}; i++)) do
        if ((i!=0 && i%30==0)) then
                wait
        fi

       osc api -X DELETE /source/$1/${files[$i]}/_constraints >/dev/null 2>&1 && echo ${files[$i]} &
done

